SET(ProjectName GSConsole)
PROJECT(${ProjectName})
CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
INCLUDE_DIRECTORIES($ENV{ServerRoot}/CommonCPlus)
INCLUDE_DIRECTORIES($ENV{ServerRoot}/CommonCPlus/IncludeKKK)
INCLUDE_DIRECTORIES($ENV{ServerRoot}/CommonCPlus/CommonCPlus)
INCLUDE_DIRECTORIES($ENV{ServerRoot}/CommonCPlus/CommonCPlus/boost)
INCLUDE_DIRECTORIES(..)
AUX_SOURCE_DIRECTORY(. DIR_SRCS)
LINK_DIRECTORIES( $ENV{ServerRoot}/Bin/$ENV{Platform}/$ENV{Configuration})
LINK_DIRECTORIES( $ENV{ServerRoot}/Lib/$ENV{Platform}/$ENV{Configuration})

SET(LIBRARY_OUT_PATH $ENV{ServerRoot}/Bin/$ENV{Platform}/$ENV{Configuration})
SET(EXECUTABLE_OUT_PATH $ENV{ServerRoot}/Bin/$ENV{Platform}/$ENV{Configuration})

SET(CMAKE_CXX_COMPILER ${CompilerSetting})
add_definitions(-std=c++11)
IF ($ENV{Configuration} STREQUAL Debug)
	SET(CMAKE_BUILD_TYPE Debug)
ELSE()
	SET(CMAKE_BUILD_TYPE Release)
ENDIF()

LINK_DIRECTORIES(${LINK_LIBPATH})

IF ($ENV{Configuration} STREQUAL Debug)
	#add_definitions(-g -lpthread -lm)
	SET(CMAKE_CXX_FLAGS_DEBUG "$ENV{CXXFLAGS} -O0 -Wall")
ELSE()
	#add_definitions(-lpthread -lm)
	SET(CMAKE_CXX_FLAGS_RELEASE "$ENV{CXXFLAGS} -O3 -Wall")
ENDIF()

ADD_EXECUTABLE(${ProjectName} ${DIR_SRCS})
TARGET_LINK_LIBRARIES (${ProjectName} WYYTools GSKernel mysqlclient rt ssl crypto boost_filesystem boost_system dl pthread)
